package net.oschina.app.adapter.open_software;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import net.oschina.app.R;
import net.oschina.app.base.BaseAdapter;
import net.oschina.app.util.CommonUtils;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by wei03 on 2017/1/14.
 */

public class OpenSCategoryAdapter extends BaseAdapter implements View.OnClickListener {
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View itemView = CommonUtils.getInflate().inflate(R.layout.item_opens_category, parent, false);
        OpenSCategoryHolder openSCategoryHolder = new OpenSCategoryHolder(itemView);
        //将创建的View注册点击事件
        itemView.setOnClickListener(this);
        return openSCategoryHolder;
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        OpenSCategoryHolder openSCategoryHolder = (OpenSCategoryHolder) holder;
    }

    @Override
    public int getItemCount() {
        return 10;
    }

    @Override
    public void onClick(View v) {

    }


    static class OpenSCategoryHolder extends RecyclerView.ViewHolder{
        @BindView(R.id.tv_open_desc)
        TextView mTvOpenDesc;

        OpenSCategoryHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }
}
